<?php
 function conexao(){
	//Gera a string de conexao:

	$host 		= "host=localhost ";//.DBHOST
	$port 		= "port=5432 ";//.DBPORT;
	$dbname 	= "dbname=comsolid ";//.DBNAME;
	$user 		= "user=comsolid ";//.DBUSER;
	$password 	= "password=comsolid ";//.PASSWD;

	$parametros = "$host $port $dbname $user $password";
	$parametros = trim($parametros);
	$link = pg_connect($parametros);
	return($link);
 }
 function desconecta($con){
 	pg_close($con);
 }
 
 //echo "Resposta: ".conexao()."<br/>";
 
?>